package com.yc;

import java.net.IDN;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.sql.SQLOutput;

/**
 * @author zwei
 * @create 2024-07-18 15:03
 */
public class Test1_InetAddress {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress ia1=InetAddress.getLocalHost();
        System.out.println(ia1);
        InetAddress[] ia2=InetAddress.getAllByName("www.baidu.com");
        if (ia2!=null){
            for (InetAddress ia:ia2){
                System.out.println(ia);
            }
        }
    }
}
